<?php
class Client {
    private $mServer = null;
    private $mFd = null;
    private $mIp = null;
    private $mPort = null;

    public function Client($server, $fd, $ip, $port) {
        $this->mFd = $fd;
        $this->mServer = $server;
        $this->mIp = $ip;
        $this->mPort = $port;
    }

    public function fd() {
        return $this->mFd;
    }

    public function addr() {
        return $this->mIp . ":" . $this->mPort;
    }

    public function send($op, $data) {
        $this->mServer->send($this->fd(), $op, $data);
    }

    public function server() {
        return $this->mServer;
    }

    public function log($msg) {
        $addr = $this->addr();
        logging::d("Anna", "[$addr]  " . $msg);
    }
};

